package org.lex.swt.app;

import java.io.File;

import org.lex.io.utils.FileUtils;
import org.lex.lang.SystemUtils;

public class LocalStorage {
	public File getUserHome() {
		return SystemUtils.getUserHome();
	}

	public File getTempHome() {
		return SystemUtils.getTempDir();
	}

	public File getApplicationHome() {
		return SystemUtils.getUserDir();
	}

	public File getApplicationConfHome() {
		File folder = new File(this.getUserHome(), "." + appName);
		FileUtils.createFolder(folder);
		return folder;
	}

	private final String appName;

	LocalStorage(String appName) {
		this.appName = appName;
	}
}
